package com.qidian.kk;

import java.util.function.Function;

public class LambdaDemo04 {
    public static void main(String[] args) {

        Integer integer = typeConver(new Function<String, Integer>() {
            @Override
            public Integer apply(String s) {
                return Integer.valueOf(s);
            }
        });
        System.out.println(integer.getClass());


        Integer integer1 = typeConver((String s) ->{
            return Integer.valueOf(s);
        });
        System.out.println(integer1.getClass());
    }

    public static <R> R typeConver(Function<String, R> function) {
        String str = "123500";
        R result  = function.apply(str);
        return result;
    }
}
